function [sinSun, cosSun] = SolDecl(mth, UT)
%
% Solar Declination
%
%DESCRIPTION:
%This function computes the sine and cosine values of Solar Declination
%(delta_Sun).
%
%PROTOTYPE:
% [sinSun, cosSun] = SolDecl(mth, UT)
%
%--------------------------------------------------------------------------
% INPUTS:
%   mth        [1x1]       Month Number              [-]
%   UT         [1x1]       Universal Time            [hours]
%--------------------------------------------------------------------------
% OUTPUTS:
%   sinSun     [1x1]       Sine of Solar Decl.       [-]
%   cosSun     [1x1]       Cosine of Solar Decl.     [-]
%--------------------------------------------------------------------------
%
%NOTES:
% (none)
%
%CALLED FUNCTIONS:
% (none)
%
%UPDATES:
% (none)
%
%REFERENCES:
% [1] "Ionospheric Correction Algorithm for Galileo Single-Frequency Users"
%      - European GNSS (Galileo) Open Service
% [2] "Electron Density Models and Data for Transionospheric Radio
%      Propagation" - Report ITU-R P.2297-1 (05/2019)
%
%AUTHOR(s):
%Luigi De Maria, Matteo D'Addazio, 2022
%

%% Main Code

%Constants
DR = pi/180;                %Conversion Factor: deg->rad

%Day of the Year (at the middle of the month)
d_y = 30.5*mth - 15;

%Time [days]
t = d_y + (18 - UT)/24;

%Argument Computation
am = (0.9856*t - 3.289) * DR;
al = am + (1.916*sin(am) + 0.020*sin(2*am) + 282.634) * DR;

%Sine and Cosine of Solar Declination
sinSun = 0.39782 * sin(al);
cosSun = sqrt(1 - sinSun^2);

end